clear; close all; clc;

%% 参数设置
a0 = -0.895;
a1 = 0.83;
a2 = 0.14;
b0 = 1.3;
b1 = 0.1;
b2 = 1.0;
d1 = 0;
d2 = 0;

%% 初始条件
x0 = 0.1;
y0 = 0.1;
z0 = 0.1;

%% 迭代参数
N_total = 200000;   % 总迭代步数

% 预分配存储数组（保存全部迭代结果）
x = zeros(N_total,1);
y = zeros(N_total,1);
z = zeros(N_total,1);

% 赋初值
x(1) = x0;
y(1) = y0;
z(1) = z0;

%% 迭代计算
for n = 1:N_total
    x(n+1) = x(n) + y(n);
    y(n+1) = sin( a0 * y(n)^2 * sin(a1 + a2 * x(n)) ) + b2 * sin(z(n)) + d1;
    z(n+1) = b0 * y(n) + b1 * z(n) + d2;
end

%% 绘图
figure;
scatter(x(1:end), z(1:end), 1, 'k', 'filled'); 
xlabel('x');
ylabel('z');
title('Fig7: x-y 吸引子图');
axis tight;
